import {createAction} from 'redux-actions';
import {
  GET_ACTIVITY_LIST
} from './../constants/actionTypes'
import * as activityApi from './../apis/activity'


export const getActivityList = createAction(GET_ACTIVITY_LIST, async(params)=>{
  return await activityApi.getActivityList(params)
    .then((data) =>{
      if (data){
        return data
      }
      throw 'activityListError'
    })
}, (params)=>{
  return {
    ...params,
    sync: 'activityList'
  }
})